#include <stdio.h> 
int x, y, z;
int s, n;

int main() { 
	printf("Please enter the values of the three cards separated by spaces(Use 1 to 10) :\n");
    scanf("%d%d%d", &x, &y, &z);
    s = x + y + z;
    n = (x == 1) + (y == 1) + (z == 1);
    int tmp = (21 - s) / 10;
    if(tmp > n) tmp = n;
    s += tmp * 10;
	if(s <= 21) printf("The score of the three cards is %d\n", s);
	else printf("Invalid input\n");
	return 0;
}